home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / QuickDraw GX / QuickDraw GX Info / QuickDraw GX Interfaces / Interfaces & Libraries / interfaces / graphics errors.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-30  |  16.9 KB  |  569 lines  |  [TEXT/MPS ]

  1. /* graphics:
  2.     public graphics error equates
  3.     by Cary Clark, Georgiann Delaney, Herb Derby, Michael Fairman, Pablo Fernicola, Dave Good, Josh Horwich, Barton House, Robert Johnson, Keith McGreggor, Mike Reed, Oliver Steele, David Van Brink, Chris Yerga
  4.     Copyright 1987 - 1994 Apple Computer, Inc.  All rights reserved.    */
  5.  
  6. #pragma once
  7.  
  8. #ifndef graphicsErrorsIncludes
  9.     #define graphicsErrorsIncludes
  10.  
  11.     #define gxFirstSystemError                -27999        /* 0xffff92a1 */
  12.     #define gxFirstFatalError                    -27999
  13.     #define gxLastFatalError                    -27951
  14.     #define gxFirstNonfatalError                -27950
  15.     #define gxFirstFontScalerError                -27900
  16.     #define gxLastFontScalerError                -27851
  17.     #define gxFirstParameterError                -27850
  18.     #define gxFirstImplementationLimitError        -27800
  19.     #define gxFirstSystemDebuggingError        -27700
  20.     #define gxLastSystemError                -27000        /* 0xffff9688 */
  21.     #define gxFirstLibraryError                1048576        /* 0x00100000 */
  22.     #define gxLastLibraryError                2097151        /* 0x001fffff */
  23.     #define gxFirstAppError                    2097152        /* 0x00200000 */
  24.     #define gxLastAppError                    4194303        /* 0x003fffff */
  25.     
  26.     #define gxFirstSystemWarning                -26999        /* 0xffff9689 */
  27.     #define gxFirstResultOutOfRangeWarning        -26950
  28.     #define gxFirstParameterOutOfRangeWarning    -26900
  29.     #define gxFirstFontScalerWarning            -26850
  30.     #define gxFirstSystemDebuggingWarning        -26700
  31.     #define gxLastSystemWarning                -26000        /* 0xffff9a70 */
  32.     #define gxFirstLibraryWarning                4194304        /* 0x00400000 */
  33.     #define gxLastLibraryWarning                5242879        /* 0x004fffff */
  34.     #define gxFirstAppWarning                5242880        /* 0x00500000 */
  35.     #define gxLastAppWarning                7340031        /* 0x006fffff */
  36.  
  37.     #define gxFirstSystemNotice                -25999        /* 0xffff9a71 */
  38.     #define gxLastSystemNotice                -25500        /* 0xffff9c64 */
  39.     #define gxFirstLibraryNotice                7340032        /* 0x00700000 */
  40.     #define gxLastLibraryNotice                7602175        /* 0x0073ffff */
  41.     #define gxFirstAppNotice                    7602176        /* 0x00740000 */
  42.     #define gxLastAppNotice                    8388607        /* 0x007fffff */
  43.  
  44.     enum gxGraphicErrors {
  45.         /* truly fatal errors */
  46.         out_of_memory = gxFirstFatalError,
  47.         internal_fatal_error,
  48.         no_outline_font_found,
  49.         not_enough_memory_for_graphics_client_heap,
  50.         could_not_create_backing_store,
  51.  
  52.         /* internal errors */
  53.         internal_error = gxFirstNonfatalError,
  54.         internal_font_error,
  55.         internal_layout_error,
  56.     
  57.         /* recoverable errors */
  58.         could_not_dispose_backing_store = internal_layout_error + 2,
  59.         unflattening_interrupted_by_client,
  60.  
  61.         /* font manager errors */
  62.         font_cannot_be_changed,
  63.         illegal_font_parameter,
  64.  
  65.         /* gxFont scaler errors */
  66.         null_font_scaler_context = gxFirstFontScalerError,
  67.         null_font_scaler_input,
  68.         invalid_font_scaler_context,
  69.         invalid_font_scaler_input,
  70.         invalid_font_scaler_font_data,
  71.         font_scaler_newblock_failed,
  72.         font_scaler_getfonttable_failed,
  73.         font_scaler_bitmap_allocation_failed,
  74.         font_scaler_outline_allocation_failed,
  75.         required_font_scaler_table_missing,
  76.         unsupported_font_scaler_outline_format,
  77.         unsupported_font_scaler_stream_format,
  78.         unsupported_font_scaler_font_format,
  79.         font_scaler_hinting_error,
  80.         font_scaler_rasterizer_error,
  81.         font_scaler_internal_error,
  82.         font_scaler_invalid_matrix,
  83.         font_scaler_fixed_overflow,
  84.         font_scaler_api_version_mismatch,
  85.         font_scaler_streaming_aborted,
  86.         unknown_font_scaler_error,
  87.  
  88.         /* bad parameters */
  89.         parameter_is_nil = gxFirstParameterError,
  90.         shape_is_nil,
  91.         style_is_nil,
  92.         transform_is_nil,
  93.         ink_is_nil,
  94.         transferMode_is_nil,
  95.         color_is_nil,
  96.         colorProfile_is_nil,
  97.         colorSet_is_nil,
  98.         spoolProcedure_is_nil,
  99.         tag_is_nil,
  100.         type_is_nil,
  101.         mapping_is_nil,
  102.         invalid_viewDevice_reference,
  103.         invalid_viewGroup_reference,
  104.         invalid_viewPort_reference,
  105.         
  106.         /* implementation limits, these should be right before the debugging errors */
  107.         number_of_contours_exceeds_implementation_limit = gxFirstImplementationLimitError,
  108.         number_of_points_exceeds_implementation_limit,
  109.         size_of_polygon_exceeds_implementation_limit,
  110.         size_of_path_exceeds_implementation_limit,
  111.         size_of_text_exceeds_implementation_limit,
  112.         size_of_bitmap_exceeds_implementation_limit,
  113.         number_of_colors_exceeds_implementation_limit,
  114.         procedure_not_reentrant
  115.  
  116.     #ifdef debugging
  117.         ,
  118.         /* internal debugging errors */
  119.         functionality_unimplemented = gxFirstSystemDebuggingError,
  120.         clip_to_frame_shape_unimplemented,
  121.     
  122.         /* font parameter debugging errors */
  123.         illegal_font_storage_type,
  124.         illegal_font_storage_reference,
  125.         illegal_font_attributes,
  126.  
  127.         /* parameter debugging errors */
  128.         parameter_out_of_range,
  129.         inconsistent_parameters,
  130.         index_is_less_than_zero,
  131.         index_is_less_than_one,
  132.         count_is_less_than_zero,
  133.         count_is_less_than_one,
  134.         contour_is_less_than_zero,
  135.         length_is_less_than_zero,
  136.         
  137.         invalid_client_reference,
  138.         invalid_graphics_heap_start_pointer,
  139.         invalid_nongraphic_globals_pointer,
  140.  
  141.         colorSpace_out_of_range,
  142.  
  143.         pattern_lattice_out_of_range,
  144.         frequency_parameter_out_of_range,
  145.         tinting_parameter_out_of_range,
  146.         method_parameter_out_of_range,
  147.         space_may_not_be_indexed,
  148.         
  149.         glyph_index_too_small,
  150.         no_glyphs_added_to_font,
  151.         glyph_not_added_to_font,
  152.         point_does_not_intersect_bitmap,
  153.  
  154.         required_font_table_not_present,
  155.         unknown_font_table_format,            /* the styles encoding is not present in the font */
  156.  
  157.         shapeFill_not_allowed,
  158.         inverseFill_face_must_set_clipLayer_flag,
  159.         invalid_transferMode_colorSpace,
  160.         colorProfile_must_be_nil,
  161.         bitmap_pixel_size_must_be_1,
  162.         empty_shape_not_allowed,
  163.         ignorePlatformShape_not_allowed,
  164.         nil_style_in_glyph_not_allowed,
  165.         complex_glyph_style_not_allowed,
  166.         invalid_mapping,
  167.         
  168.         cannot_set_item_shapes_to_nil,
  169.         cannot_use_original_item_shapes_when_growing_picture,
  170.         cannot_add_unspecified_new_glyphs,
  171.         cannot_dispose_locked_tag,
  172.         cannot_dispose_locked_shape,
  173.     
  174.         /* restricted access */
  175.         shape_access_not_allowed,
  176.         colorSet_access_restricted,
  177.         colorProfile_access_restricted,
  178.         tag_access_restricted,
  179.         viewDevice_access_restricted,
  180.         
  181.         graphic_type_does_not_have_a_structure,
  182.         style_run_array_does_not_match_number_of_characters,
  183.         rectangles_cannot_be_inserted_into,
  184.         
  185.         unknown_graphics_heap,
  186.         graphics_routine_selector_is_obsolete,
  187.         cannot_set_graphics_client_memory_without_setting_size,
  188.         graphics_client_memory_too_small,
  189.         graphics_client_memory_is_already_allocated,
  190.         
  191.         viewPort_is_a_window,
  192.  
  193.         /* wrong type/bad reference */
  194.         illegal_type_for_shape,
  195.         shape_does_not_contain_a_bitmap,
  196.         shape_does_not_contain_text,
  197.         picture_expected,
  198.         bitmap_is_not_resizable,
  199.         shape_may_not_be_a_bitmap,
  200.         shape_may_not_be_a_picture,
  201.         graphic_type_does_not_contain_points,
  202.         graphic_type_does_not_have_multiple_contours,
  203.         graphic_type_cannot_be_mapped,
  204.         graphic_type_cannot_be_moved,
  205.         graphic_type_cannot_be_scaled,
  206.         graphic_type_cannot_be_rotated,
  207.         graphic_type_cannot_be_skewed,
  208.         graphic_type_cannot_be_reset,
  209.         graphic_type_cannot_be_dashed,
  210.         graphic_type_cannot_be_reduced,
  211.         graphic_type_cannot_be_inset,
  212.         shape_cannot_be_inverted,
  213.         shape_does_not_have_area,
  214.         shape_does_not_have_length,    
  215.         first_glyph_advance_must_be_absolute,
  216.         picture_cannot_contain_itself,
  217.         viewPort_cannot_contain_itself,
  218.         cannot_set_unique_items_attribute_when_picture_contains_items,
  219.         layer_style_cannot_contain_a_face,
  220.         layer_glyph_shape_cannot_contain_nil_styles,
  221.  
  222.         /* validation errors */
  223.         object_wrong_type,
  224.         shape_wrong_type,
  225.         style_wrong_type,
  226.         ink_wrong_type,
  227.         transform_wrong_type,
  228.         device_wrong_type,
  229.         port_wrong_type,
  230.             /* validation cache errors */
  231.         shape_cache_wrong_type,
  232.         style_cache_wrong_type,
  233.         ink_cache_wrong_type,
  234.         transform_cache_wrong_type,
  235.         port_cache_wrong_type,
  236.         shape_cache_parent_mismatch,
  237.         style_cache_parent_mismatch,
  238.         ink_cache_parent_mismatch,
  239.         transform_cache_parent_mismatch,
  240.         port_cache_parent_mismatch,
  241.         invalid_shape_cache_port,
  242.         invalid_shape_cache_device,
  243.         invalid_ink_cache_port,
  244.         invalid_ink_cache_device,
  245.         invalid_style_cache_port,
  246.         invalid_style_cache_device,
  247.         invalid_transform_cache_port,
  248.         invalid_transform_cache_device,
  249.         recursive_caches,
  250.             /* validation shape cache errors */
  251.         invalid_fillShape_ownerCount,
  252.         recursive_fillShapes,
  253.             /* validation memory block errors */
  254.         indirect_memory_block_too_small,
  255.         indirect_memory_block_too_large,
  256.         unexpected_nil_pointer,
  257.         bad_address,
  258.             /* validation object errors */
  259.         no_owners,
  260.         invalid_pointer,
  261.         invalid_seed,
  262.         invalid_frame_seed,
  263.         invalid_text_seed,
  264.         invalid_draw_seed,
  265.         bad_private_flags,
  266.             /* validation path and polygon errors */
  267.         invalid_vector_count,
  268.         invalid_contour_count,
  269.             /* validation bitmap errors */
  270.         bitmap_ptr_too_small,
  271.         bitmap_ptr_not_aligned,
  272.         bitmap_rowBytes_negative,
  273.         bitmap_width_negative,
  274.         bitmap_height_negative,
  275.         invalid_pixelSize,
  276.         bitmap_rowBytes_too_small,
  277.         bitmap_rowBytes_not_aligned,
  278.         bitmap_rowBytes_must_be_specified_for_user_image_buffer,
  279.             /* validation bitmap image errors */
  280.         invalid_bitImage_fileOffset,
  281.         invalid_bitImage_owners,
  282.         invalid_bitImage_rowBytes,
  283.         invalid_bitImage_internal_flag,
  284.             /* validation text errors */
  285.         text_bounds_cache_wrong_size,
  286.         text_metrics_cache_wrong_size,
  287.         text_index_cache_wrong_size,
  288.             /* validation glyph errors */
  289.         glyph_run_count_negative,
  290.         glyph_run_count_zero,
  291.         glyph_run_counts_do_not_sum_to_character_count,
  292.         glyph_first_advance_bit_set_not_allowed,
  293.         glyph_tangent_vectors_both_zero,
  294.             /* validation layout errors */
  295.         layout_run_length_negative,
  296.         layout_run_length_zero,
  297.         layout_run_level_negative,
  298.         layout_run_lengths_do_not_sum_to_text_length,
  299.             /* validation picture errors */
  300.         bad_shape_in_picture,
  301.         bad_style_in_picture,
  302.         bad_ink_in_picture,
  303.         bad_transform_in_picture,
  304.         bad_shape_cache_in_picture,
  305.         bad_seed_in_picture,
  306.         invalid_picture_count,
  307.             /* validation text face errors */
  308.         bad_textLayer_count,
  309.         bad_fillType_in_textFace,
  310.         bad_style_in_textFace,
  311.         bad_transform_in_textFace,
  312.             /* validation transform errors */
  313.         invalid_matrix_flag,
  314.         transform_clip_missing,
  315.             /* validation font cache errors */
  316.         metrics_wrong_type,
  317.         metrics_point_size_probably_bad,
  318.         scalar_block_wrong_type,
  319.         scalar_block_parent_mismatch,
  320.         scalar_block_too_small,
  321.         scalar_block_too_large,
  322.         invalid_metrics_range,
  323.         invalid_metrics_flags,
  324.         metrics_maxWidth_probably_bad,
  325.         font_wrong_type,
  326.         font_wrong_size,
  327.         invalid_font_platform,
  328.         invalid_lookup_range,
  329.         invalid_lookup_platform,
  330.         font_not_in_font_list,
  331.         metrics_not_in_metrics_list,
  332.             /* validation view device errors */
  333.         bad_device_private_flags,
  334.         bad_device_attributes,
  335.         invalid_device_number,
  336.         invalid_device_viewGroup,
  337.         invalid_device_bounds,
  338.         invalid_bitmap_in_device,
  339.             /* validation color set errors */
  340.         colorSet_wrong_type,
  341.         invalid_colorSet_viewDevice_owners,
  342.         invalid_colorSet_colorSpace,
  343.         invalid_colorSet_count,
  344.             /* validation color profile errors */
  345.         colorProfile_wrong_type,
  346.         invalid_colorProfile_flags,
  347.         invalid_colorProfile_response_count,
  348.             /* validation internal backing store errors */
  349.         backing_free_parent_mismatch,
  350.         backing_store_parent_mismatch
  351.     #endif
  352.     };
  353.  
  354.         #define common_colors_not_initialized    gxFirstLibraryError
  355.         #define no_open_picture                (gxFirstLibraryError + 1)
  356.         #define picture_already_open            (gxFirstLibraryError + 2)
  357.         #define no_open_poly                (gxFirstLibraryError + 3)
  358.         #define poly_already_open            (gxFirstLibraryError + 4)
  359.         #define no_open_region                (gxFirstLibraryError + 5)
  360.         #define region_already_open            (gxFirstLibraryError + 6)
  361.         #define no_active_picture                (gxFirstLibraryError + 7)
  362.  
  363.     enum gxGraphicWarnings {
  364.         /* warnings about warnings */
  365.         warning_stack_underflow = gxFirstSystemWarning,
  366.         warning_stack_overflow,
  367.         notice_stack_underflow,
  368.         notice_stack_overflow,
  369.         about_to_grow_heap,
  370.         about_to_unload_objects,
  371.  
  372.         /* result went out of range */
  373.         map_shape_out_of_range = gxFirstResultOutOfRangeWarning,
  374.         move_shape_out_of_range,
  375.         scale_shape_out_of_range,
  376.         rotate_shape_out_of_range,
  377.         skew_shape_out_of_range,
  378.         map_transform_out_of_range,
  379.         move_transform_out_of_range,
  380.         scale_transform_out_of_range,
  381.         rotate_transform_out_of_range,
  382.         skew_transform_out_of_range,
  383.         map_points_out_of_range,
  384.         
  385.         /* gave a parameter out of range */
  386.         contour_out_of_range = gxFirstParameterOutOfRangeWarning,
  387.         index_out_of_range_in_contour,
  388.         picture_index_out_of_range,
  389.         color_index_requested_not_found,
  390.         colorSet_index_out_of_range,
  391.         index_out_of_range,
  392.         count_out_of_range,
  393.         length_out_of_range,
  394.         font_table_index_out_of_range,
  395.         font_glyph_index_out_of_range,
  396.         point_out_of_range,
  397.         profile_response_out_of_range,
  398.  
  399.         /* gxFont scaler warnings */
  400.         font_scaler_no_output = gxFirstFontScalerWarning,
  401.         font_scaler_fake_metrics,
  402.         font_scaler_fake_linespacing,
  403.         font_scaler_glyph_substitution,
  404.         font_scaler_no_kerning_applied,
  405.  
  406.         /* might not be what you expected */
  407.         character_substitution_took_place,
  408.         unable_to_get_bounds_on_multiple_devices,
  409.         font_language_not_found,
  410.         font_not_found_during_unflattening,
  411.  
  412.         /*storage */
  413.         unrecognized_stream_version,
  414.         bad_data_in_stream
  415.         
  416.     #ifdef debugging
  417.         ,
  418.         /* nonsense data */
  419.         new_shape_contains_invalid_data = gxFirstSystemDebuggingWarning,
  420.         new_tag_contains_invalid_data,
  421.         extra_data_passed_was_ignored,
  422.         font_table_not_found,
  423.         font_name_not_found,
  424.  
  425.         /* doesn't make sense to do */
  426.         unable_to_traverse_open_contour_that_starts_or_ends_off_the_curve,
  427.         unable_to_draw_open_contour_that_starts_or_ends_off_the_curve,
  428.         cannot_dispose_default_shape,
  429.         cannot_dispose_default_style,
  430.         cannot_dispose_default_ink,
  431.         cannot_dispose_default_transform,
  432.         cannot_dispose_default_colorProfile,
  433.         cannot_dispose_default_colorSet,
  434.         shape_direct_attribute_not_set,
  435.  
  436.         /* couldn't find what you were looking for */
  437.         point_does_not_intersect_port,
  438.         cannot_dispose_non_font,
  439.         face_override_style_font_must_match_style,
  440.  
  441.         union_of_area_and_length_returns_area_only,
  442.         insufficient_coordinate_space_for_new_device,
  443.     
  444.         /* other */
  445.         shape_passed_has_no_bounds,
  446.         tags_of_type_flst_removed,
  447.         translator_not_installed_on_this_grafport
  448.     #endif
  449.     };
  450.  
  451.         #define no_picture_drawn                            gxFirstLibraryWarning
  452.         #define polygons_have_different_size_contours        (gxFirstLibraryWarning + 1)
  453.         #define graphic_type_cannot_be_specifed_by_four_values (gxFirstLibraryWarning + 2)
  454.         #define graphic_type_cannot_be_specifed_by_six_values    (gxFirstLibraryWarning + 3)
  455.         #define point_expected                            (gxFirstLibraryWarning + 4)
  456.         #define line_or_rectangle_expected                    (gxFirstLibraryWarning + 5)
  457.         #define curve_expected                            (gxFirstLibraryWarning + 6)
  458.         #define graphic_type_does_not_contain_control_bits    (gxFirstLibraryWarning + 7)
  459.         #define request_exceeds_available_data                (gxFirstLibraryWarning + 8)
  460.         #define extra_data_unread                        (gxFirstLibraryWarning + 9)
  461.         #define no_variable_length_user_data_saved            (gxFirstLibraryWarning + 10)
  462.  
  463.  
  464.     enum gxGraphicNotices {
  465.         parameters_have_no_effect = gxFirstSystemNotice,
  466.         attributes_already_set,
  467.         caps_already_set,
  468.         clip_already_set,
  469.         color_already_set,
  470.         curve_error_already_set,
  471.         dash_already_set,
  472.         default_colorProfile_already_set,
  473.         default_ink_already_set,
  474.         default_transform_already_set,
  475.         default_shape_already_set,
  476.         default_style_already_set,
  477.         dither_already_set,
  478.         encoding_already_set,
  479.         face_already_set,
  480.         fill_already_set,
  481.         font_already_set,
  482.         font_variations_already_set,
  483.         glyph_positions_are_already_set,
  484.         glyph_tangents_are_already_set,
  485.         halftone_already_set,
  486.         hit_test_already_set,
  487.         ink_already_set,
  488.         join_already_set,
  489.         justification_already_set,
  490.         mapping_already_set,
  491.         pattern_already_set,
  492.         pen_already_set,
  493.         style_already_set,
  494.         tag_already_set,
  495.         text_attributes_already_set,
  496.         text_size_already_set,
  497.         transfer_already_set,
  498.         translator_already_installed_on_this_grafport,
  499.         transform_already_set,
  500.         type_already_set,
  501.         validation_level_already_set,
  502.         viewPorts_already_set,
  503.         viewPort_already_in_viewGroup,
  504.         viewDevice_already_in_viewGroup,
  505.         
  506.         geometry_unaffected,
  507.         mapping_unaffected,
  508.         tags_in_shape_ignored,
  509.  
  510.         shape_already_in_primitive_form,
  511.         shape_already_in_simple_form,
  512.         shape_already_broken,
  513.         shape_already_joined,
  514.         cache_already_cleared,
  515.  
  516.         shape_not_disposed,
  517.         style_not_disposed,
  518.         ink_not_disposed,
  519.         transform_not_disposed,
  520.         colorSet_not_disposed,
  521.         colorProfile_not_disposed,
  522.         font_not_disposed,
  523.  
  524.         glyph_tangents_have_no_effect,
  525.         glyph_positions_determined_by_advance,
  526.         transform_viewPorts_already_set,
  527.  
  528.         directShape_attribute_set_as_side_effect,
  529.         lockShape_called_as_side_effect,
  530.         lockTag_called_as_side_effect,
  531.         shapes_unlocked_as_side_effect,
  532.         shape_not_locked,
  533.         tag_not_locked,
  534.  
  535.         disposed_dead_caches,
  536.         disposed_live_caches,
  537.         low_on_memory,
  538.         very_low_on_memory,
  539.  
  540.         transform_references_disposed_viewPort
  541.     };
  542.  
  543.         #define zero_length_string_passed            gxFirstLibraryNotice
  544.  
  545.  
  546.     typedef long gxGraphicsError;
  547.     typedef long gxGraphicsWarning;
  548.     typedef long gxGraphicsNotice;
  549.  
  550. #ifdef __cplusplus
  551. extern "C" {
  552. #endif
  553.     #pragma procname gxUserError
  554.     typedef void (*gxUserErrorProcPtr)(gxGraphicsError status, long refcon );
  555.     typedef gxUserErrorProcPtr gxUserErrorFunction;
  556.  
  557.     #pragma procname gxUserWarning
  558.     typedef void (*gxUserWarningProcPtr)(gxGraphicsWarning status, long refcon );
  559.     typedef gxUserWarningProcPtr gxUserWarningFunction;
  560.  
  561.     #pragma procname gxUserNotice
  562.     typedef void (*gxUserNoticeProcPtr)(gxGraphicsNotice staus, long refcon );
  563.     typedef gxUserNoticeProcPtr gxUserNoticeFunction;
  564. #ifdef __cplusplus
  565. }
  566. #endif
  567.         
  568. #endif
  569.